#include "stdio.h"

int fullarraged(char* str, int offset, int length)
{
    if (NULL == str)
    {
    	printf("%s", str);
        return 0;
    }
		
    if (length <= 0)
    	return -1;
    
    if (1 == length)
    {
    	printf("%s\n", str);
    	return 0;
    }	

    char temp=str[offset];
    
    for(int i = 1; i < length; i++ )
	{
		fullarraged(str, i, length - i);
		printf("%s\n", str+i);
		
		temp = str[offset];
		printf("%s\n", str + offset);
		printf("%c\n", temp);
		printf("%s\n", str + i);
		*(str + offset) = *(str + i);

		*(str + i) = temp;

		printf("%s\n", str+i);
	}
}

 int main(int argc, char const *argv[])
{
	/* code */
	char* str;
	str = "ab";
	//fullarraged(str, 0, 2);
	str[0] = 'b';
	printf("%s\n", str);
	str[1] = 'a';
	printf("%s\n", str);
	return 0;
}